#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
	vector<int> coll;
	vector<int>::iterator pos;

	coll.push_back( 3 );
	coll.push_back( 7 );
	coll.push_back( 2 );

	//
	pos = min_element( coll.begin(), coll.end() );
	cout << "min: " << *pos << endl;
	pos = max_element( coll.begin(), coll.end() );
	cout << "max: " << *pos << endl;

	//
	sort( coll.begin(), coll.end() );
	for( pos = coll.begin(); pos != coll.end(); ++pos )
		cout << *pos << " ";
	cout << endl;

	//
	reverse( coll.begin(), coll.end() );
	for( pos = coll.begin(); pos != coll.end(); ++pos )
		cout << *pos << " ";
	cout << endl;

	return 0;
}

